package a.j.b;

import a.c.bb;
import a.c.e;
import a.d.u;
import a.j.g;
import a.j.*;

import java.awt.*;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.geom.Rectangle2D;
import java.util.Iterator;
import java.util.List;

public class h
  implements DropTargetListener
{
  private pg a;
  private g.c_ b;
  private g.a_ c;
  private double d;
  private double e;
  private double f;
  private u g;
  private int h;
  private m i;
  private f j = null;
  private f.o_ k = null;
  private int l;
  private boolean m = false;
  public static boolean n;
  
  public h(pg parampg)
  {
    this.a = parampg;
    this.e = 10.0D;
    this.f = this.e;
    this.d = 100.0D;
    this.g = new u(10.0D, 0.0D, 0.0D, 0.0D);
    this.h = 2147483647;
    this.i = new m();
    this.b = new g.c_();
  }
  
  public m a()
  {
    return this.i;
  }
  
  public void a(m paramm)
  {
    this.i = paramm;
  }
  
  protected qb a(Rectangle2D paramRectangle2D, u paramu)
  {
    if (f.Wb == 0)
    {
      if (this.c == null) {
        this.c = new g.a_();
      }
      this.c.a(paramRectangle2D.getX(), paramRectangle2D.getY(), paramRectangle2D.getWidth(), paramRectangle2D.getHeight());
      this.c.a(paramu);
    }
    return this.c;
  }
  
  public void dragEnter(DropTargetDragEvent paramDropTargetDragEvent)
  {
    Point localPoint = paramDropTargetDragEvent.getLocation();
    double d1 = this.a.f(localPoint.x);
    double d2 = this.a.g(localPoint.y);
    this.b.a(a(new Rectangle2D.Double(d1, d2, this.f, this.d), this.g));
    this.a.a(this.b);
    this.a.b();
  }
  
  public void dragOver(DropTargetDragEvent paramDropTargetDragEvent)
  {
    int i2 = f.Wb;
    boolean bool = f.Vb;
    if (this.b.a() != null)
    {
      Point localPoint = paramDropTargetDragEvent.getLocation();
      double d1 = this.a.f(localPoint.x);
      double d2 = this.a.g(localPoint.y);
      sc localsc = new sc(this.a, d1, d2, true);
      double d3 = d1;
      double d4 = d2;
      double d5 = this.f;
      double d6 = this.d;
      u localu = this.g;
      e locale = a(localsc);
      if (i2 == 0)
      {
        if (locale != null)
        {
          g localg = this.a.a();
          ld localld = a(localg, locale);
          if (i2 == 0)
          {
            if ((localld instanceof f))
            {
              this.j = ((f)localld);
              a(this.j, d1, d2);
            }
          }
          else
          {
            if (i2 == 0)
            {
              if (this.m)
              {
                d5 = this.j.fb();
                localu = this.j.hb();
              }
              if (i2 != 0) {}
            }
            else if ((this.k instanceof f.r_))
            {
              localObject1 = this.k.l();
              if (i2 == 0) {}
              localObject2 = (f.n_)((List)localObject1).get(((List)localObject1).size() > this.l ? this.l : this.l - 1);
              localRectangle2D1 = ((f.n_)localObject2).h();
              double d7 = ((List)localObject1).size() <= this.l ? localRectangle2D1.getWidth() : 0.0D;
              d3 = localRectangle2D1.getX() + d7;
              d4 = localRectangle2D1.getY();
              d6 = localRectangle2D1.getHeight();
              if (i2 != 0) {
                break label688;
              }
              if (!bool) {
                break label660;
              }
            }
            Object localObject1 = (f.n_)this.k;
            Object localObject2 = ((f.n_)localObject1).l();
            if (i2 == 0) {
              if (((List)localObject2).isEmpty())
              {
                Rectangle2D localRectangle2D2 = ((f.n_)localObject1).h();
                localObject3 = ((f.n_)localObject1).i();
                if (i2 == 0)
                {
                  if (localObject3 != null)
                  {
                    d8 = localRectangle2D2.getWidth() - ((u)localObject3).c - ((u)localObject3).e;
                    d3 = localRectangle2D2.getX() + ((u)localObject3).c;
                    d4 = localRectangle2D2.getY() + ((u)localObject3).b;
                    d6 = localRectangle2D2.getHeight() - ((u)localObject3).b - ((u)localObject3).d;
                    if (i2 != 0) {
                      break label688;
                    }
                    if (d8 <= d5) {
                      break label660;
                    }
                    d5 = d8;
                    if (i2 != 0) {
                      break label688;
                    }
                    if (!bool) {
                      break label660;
                    }
                  }
                  d3 = localRectangle2D2.getX();
                  d4 = localRectangle2D2.getY();
                  d6 = localRectangle2D2.getHeight();
                }
                if (i2 != 0) {
                  break label688;
                }
                if (localRectangle2D2.getWidth() <= d5) {
                  break label660;
                }
                d5 = localRectangle2D2.getWidth();
                if (i2 != 0) {
                  break label688;
                }
                if (!bool) {
                  break label660;
                }
              }
            }
            if (i2 == 0) {}
            int i1 = ((List)localObject2).size() > this.l ? 1 : 0;
            if (i2 == 0) {}
            Object localObject3 = (f.n_)((List)localObject2).get(i1 != 0 ? this.l : this.l - 1);
            Rectangle2D localRectangle2D1 = ((f.n_)localObject3).h();
            double d8 = i1 != 0 ? 0.0D : localRectangle2D1.getWidth();
            d3 = localRectangle2D1.getX() + d8;
            d4 = localRectangle2D1.getY();
            d6 = localRectangle2D1.getHeight();
            if (i2 != 0) {
              break label688;
            }
            if (!bool) {
              break label660;
            }
          }
          this.j = null;
        }
        label660:
        this.b.a(a(new Rectangle2D.Double(d3, d4, d5, d6), localu));
      }
      label688:
      this.a.b();
    }
  }
  
  private e a(sc paramsc)
  {
    int i1 = f.Wb;
    if (i1 == 0) {
      if (paramsc.x()) {
        return paramsc.m();
      }
    }
    if ((i1 != 0) || (paramsc.w())) {
      return paramsc.p().gb();
    }
    return null;
  }
  
  public void dropActionChanged(DropTargetDragEvent paramDropTargetDragEvent) {}
  
  public void dragExit(DropTargetEvent paramDropTargetEvent)
  {
    c();
  }
  
  public void drop(DropTargetDropEvent paramDropTargetDropEvent)
  {
    int i1 = f.Wb;
    if (i1 == 0) {
      if (this.b.a() != null)
      {
        Point localPoint = paramDropTargetDropEvent.getLocation();
        double d1 = this.a.f(localPoint.x);
        double d2 = this.a.g(localPoint.y);
        sc localsc = new sc(this.a, d1, d2, true);
        e locale = a(localsc);
        if (i1 != 0) {
          return;
        }
        if (locale != null)
        {
          g localg = this.a.a();
          ld localld1 = a(localg, locale);
          if (i1 != 0) {
            return;
          }
          if ((localld1 instanceof f))
          {
            this.j = ((f)localld1);
            a(this.j, d1, d2);
            if (i1 != 0) {
              break label255;
            }
            if (this.k != null)
            {
              localg.z();
              try
              {
                localg.a(new bb(locale).l());
                ld localld2 = a(localg, locale);
                if (i1 == 0) {
                  if (localld2 == this.j)
                  {
                    a(this.k);
                    if (i1 != 0) {
                      break label241;
                    }
                    if (!f.Vb) {
                      break label236;
                    }
                  }
                }
                if ((localld2 instanceof f)) {
                  a(m.a(this.k, (f)localld2));
                }
              }
              finally
              {
                label236:
                label241:
                localg.A();
              }
            }
          }
        }
      }
    }
    label255:
    c();
  }
  
  private void a(f.o_ paramo_)
  {
    int i1 = f.Wb;
    double d1 = (i1 != 0) || ((paramo_ instanceof f.n_)) ? ((f.n_)paramo_).g() : -1.0D;
    f.n_ localn_1 = this.i.a(paramo_, this.l);
    if (i1 == 0)
    {
      if (!this.m) {
        localn_1.a(e());
      }
    }
    else
    {
      u localu1 = f();
      if (localu1 != null) {
        localn_1.a(new u(localu1.b, localu1.c, localu1.d, localu1.e));
      }
      if (i1 == 0) {
        if (paramo_.k() == 1)
        {
          f.n_ localn_2 = (f.n_)paramo_;
          u localu2 = localn_2.i();
          double d2 = (i1 != 0) || (localu2 != null) ? localu2.c + localu2.e : 0.0D;
          if (i1 == 0) {}
          double d3 = this.f + d2 >= d1 ? this.f : d1 - d2;
          this.i.a(localn_1, d3, false);
          if ((i1 == 0) && (!f.Vb)) {
            return;
          }
        }
      }
      this.i.a(localn_1, this.f, false);
    }
  }
  
  private void c()
  {
    if (f.Wb == 0)
    {
      if (this.b.a() != null)
      {
        this.b.a(null);
        this.a.b(this.b);
        this.a.b();
      }
      this.j = null;
      this.k = null;
    }
    this.l = 0;
  }
  
  private void a(f paramf, double paramDouble1, double paramDouble2)
  {
    int i3 = f.Wb;
    boolean bool = f.Vb;
    f.n_ localn_1 = paramf.eb().b(paramDouble1, paramDouble2);
    label153:
    label155:
    Object localObject;
    if (localn_1 != null)
    {
      int i1 = 1;
      f.o_ localo_ = localn_1.a();
      do
      {
        do
        {
          if (!(localo_ instanceof f.n_)) {
            break;
          }
          i1++;
          if (i3 != 0) {
            break label155;
          }
          localo_ = ((f.n_)localo_).a();
          if (bool) {
            break label153;
          }
        } while (!bool);
      } while (i3 != 0);
      if ((i3 != 0) || (i1 > this.h))
      {
        int i2 = i1 - this.h;
        do
        {
          do
          {
            if (i2 <= 0) {
              break;
            }
            if (i3 != 0) {
              break label155;
            }
            localn_1 = (f.n_)localn_1.a();
            i2--;
            if (bool) {
              break label153;
            }
          } while (!bool);
        } while (i3 != 0);
        i1 = this.h;
      }
      Rectangle2D localRectangle2D = localn_1.h();
      localObject = localn_1.i();
      if (i3 == 0) {
        if (i1 != this.h)
        {
          if (i3 != 0) {
            break label310;
          }
          if (localObject == null) {
            break label297;
          }
          if (i3 == 0) {
            if (paramDouble2 >= localRectangle2D.getY() + ((u)localObject).b) {
              break label297;
            }
          }
        }
        else
        {
          this.k = localn_1.a();
        }
      }
      if (i3 == 0) {
        if (paramDouble1 < localRectangle2D.getX() + localRectangle2D.getWidth() / 2.0D)
        {
          this.l = localn_1.b();
          if (i3 == 0) {
            if (!bool) {
              return;
            }
          }
        }
        else
        {
          this.l = (localn_1.b() + 1);
          if (i3 != 0) {
            break label303;
          }
        }
      }
      if (bool)
      {
        label297:
        this.k = localn_1;
        label303:
        if (i3 == 0)
        {
          if (localObject != null)
          {
            label310:
            if (i3 != 0) {
              break label362;
            }
            if (paramDouble1 < localRectangle2D.getX() + ((u)localObject).c)
            {
              this.l = 0;
              if (i3 != 0) {
                break label362;
              }
              if (!bool) {
                return;
              }
            }
          }
          this.l = localn_1.k();
        }
        label362:
        if (!bool) {}
      }
    }
    else
    {
      f.r_ localr_ = paramf.eb();
      this.k = localr_;
      this.l = 0;
      double d1 = paramf.a();
      d1 += paramf.tb();
      localObject = localr_.l().iterator();
      do
      {
        if (!((Iterator)localObject).hasNext()) {
          break;
        }
        f.n_ localn_2 = (f.n_)((Iterator)localObject).next();
        if (i3 == 0)
        {
          if (paramDouble1 < d1 + localn_2.g() / 2.0D) {
            break;
          }
          this.l += 1;
          d1 += localn_2.g();
        }
      } while (!bool);
    }
  }
  
  public double d()
  {
    return this.f;
  }
  
  public void a(double paramDouble)
  {
    this.f = Math.max(paramDouble, e());
  }
  
  public double e()
  {
    return this.e;
  }
  
  public void b(double paramDouble)
  {
    if (f.Wb == 0)
    {
      this.e = paramDouble;
      if (paramDouble <= d()) {}
    }
    else
    {
      a(paramDouble);
    }
  }
  
  public u f()
  {
    return this.g;
  }
  
  public void a(u paramu)
  {
    this.g = paramu;
  }
  
  public int g()
  {
    return this.h;
  }
  
  public void a(int paramInt)
  {
    if (paramInt > 0) {
      this.h = paramInt;
    }
  }
  
  public boolean h()
  {
    return this.m;
  }
  
  public void a(boolean paramBoolean)
  {
    this.m = paramBoolean;
  }
  
  public double i()
  {
    return this.d;
  }
  
  public void c(double paramDouble)
  {
    this.d = paramDouble;
  }
  
  private static ld a(g paramg, e parame)
  {
    return m.a(paramg, parame);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.b.h

 * JD-Core Version:    0.7.0.1

 */